<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>fs (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
       <span class="fn">testing.fs</span>
</div>

<hr/>


  <h2>Classes</h2>
 <div class="fn-constructor">
        <a href="class_goog_testing_fs_Blob.html">
          goog.testing.fs.Blob</a><br/>
        <div class="class-details">A mock Blob object. The data is stored as a string.</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_testing_fs_DirectoryEntry.html">
          goog.testing.fs.DirectoryEntry</a><br/>
        <div class="class-details">A mock directory entry object.</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_testing_fs_Entry.html">
          goog.testing.fs.Entry</a><br/>
        <div class="class-details">A mock filesystem entry object.</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_testing_fs_File.html">
          goog.testing.fs.File</a><br/>
        <div class="class-details">A mock file object.</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_testing_fs_FileEntry.html">
          goog.testing.fs.FileEntry</a><br/>
        <div class="class-details">A mock file entry object.</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_testing_fs_FileReader.html">
          goog.testing.fs.FileReader</a><br/>
        <div class="class-details">A mock FileReader object. This emits the same events as
goog.fs.FileReader.</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_testing_fs_FileSystem.html">
          goog.testing.fs.FileSystem</a><br/>
        <div class="class-details">A mock filesystem object.</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_testing_fs_FileWriter.html">
          goog.testing.fs.FileWriter</a><br/>
        <div class="class-details">A mock FileWriter object. This emits the same events as
goog.fs.FileSaver and goog.fs.FileWriter.</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_testing_fs_ProgressEvent.html">
          goog.testing.fs.ProgressEvent</a><br/>
        <div class="class-details">A mock progress event.</div>
 </div>
   
<br/>

  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>




  <h2>Global Functions</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.testing.fs.blobToString"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.testing.fs.</span><span class="entryName">blobToString<span class="args">(<span class="arg">blob</span>,&nbsp;<span class="arg">opt_encoding</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="class_goog_async_Deferred.html">goog.async.Deferred</a></span></div>
      </div>


     <div class="entryOverview">
       Returns the string value of a fake blob.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">blob</span>
        : <div class="fullType"><span class="type"><a href="class_goog_testing_fs_Blob.html">goog.testing.fs.Blob</a></span></div>
        <div class="entryOverview">The blob to convert to a string.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_encoding</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>)</div>
        <div class="entryOverview">Ignored.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="class_goog_async_Deferred.html">goog.async.Deferred</a></span></div>&nbsp;
            The deferred string value of the blob.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_testing_fs_fs.js.source.html#line123">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.testing.fs.createObjectUrl"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.testing.fs.</span><span class="entryName">createObjectUrl<span class="args">(<span class="arg">blob</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
      </div>


     <div class="entryOverview">
       Create a fake object URL for a given fake blob. This can be used as a real
URL, and it can be created and revoked normally.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">blob</span>
        : <div class="fullType"><span class="type"><a href="class_goog_testing_fs_Blob.html">goog.testing.fs.Blob</a></span></div>
        <div class="entryOverview">The blob for which to create the URL.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>&nbsp;
            The URL.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_testing_fs_fs.js.source.html#line76">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.testing.fs.getBlob"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.testing.fs.</span><span class="entryName">getBlob<span class="args">(<span class="arg">var_args</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="class_goog_testing_fs_Blob.html">goog.testing.fs.Blob</a></span></div>
      </div>


     <div class="entryOverview">
       Concatenates one or more values together and converts them to a fake blob.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">var_args</span>
        : <div class="fullType">(<span class="type"><a href="class_goog_testing_fs_Blob.html">goog.testing.fs.Blob</a></span><span>&nbsp;|&nbsp;</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>)</div>
        <div class="entryOverview">The values that will make up the resulting blob.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="class_goog_testing_fs_Blob.html">goog.testing.fs.Blob</a></span></div>&nbsp;
            The blob.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_testing_fs_fs.js.source.html#line111">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.testing.fs.getPersistent"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.testing.fs.</span><span class="entryName">getPersistent<span class="args">(<span class="arg">size</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="class_goog_async_Deferred.html">goog.async.Deferred</a></span></div>
      </div>


     <div class="entryOverview">
       Get a filesystem object. Since these are mocks, there's no difference between
temporary and persistent filesystems.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">size</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">Ignored.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="class_goog_async_Deferred.html">goog.async.Deferred</a></span></div>&nbsp;
            The deferred goog.testing.fs.FileSystem.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_testing_fs_fs.js.source.html#line56">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.testing.fs.getTemporary"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.testing.fs.</span><span class="entryName">getTemporary<span class="args">(<span class="arg">size</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="class_goog_async_Deferred.html">goog.async.Deferred</a></span></div>
      </div>


     <div class="entryOverview">
       Get a filesystem object. Since these are mocks, there's no difference between
temporary and persistent filesystems.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">size</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">Ignored.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="class_goog_async_Deferred.html">goog.async.Deferred</a></span></div>&nbsp;
            The deferred goog.testing.fs.FileSystem.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_testing_fs_fs.js.source.html#line40">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.testing.fs.install"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.testing.fs.</span><span class="entryName">install<span class="args">(<span class="arg">stubs</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Installs goog.testing.fs in place of the standard goog.fs. After calling
this, code that uses goog.fs should work without issue using goog.testing.fs.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">stubs</span>
        : <div class="fullType"><span class="type"><a href="class_goog_testing_PropertyReplacer.html">goog.testing.PropertyReplacer</a></span></div>
        <div class="entryOverview">The property replacer for stubbing out the original goog.fs functions.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_testing_fs_fs.js.source.html#line137">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.testing.fs.isObjectUrlGranted"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.testing.fs.</span><span class="entryName">isObjectUrlGranted<span class="args">(<span class="arg">blob</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span></div>
      </div>


     <div class="entryOverview">
       Return whether or not a URL has been granted for the given blob.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">blob</span>
        : <div class="fullType"><span class="type"><a href="class_goog_testing_fs_Blob.html">goog.testing.fs.Blob</a></span></div>
        <div class="entryOverview">The blob to check.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span></div>&nbsp;
            Whether a URL has been granted.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_testing_fs_fs.js.source.html#line99">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.testing.fs.revokeObjectUrl"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.testing.fs.</span><span class="entryName">revokeObjectUrl<span class="args">(<span class="arg">url</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Remove a URL that was created for a fake blob.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">url</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">The URL to revoke.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_testing_fs_fs.js.source.html#line88">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>



  <h2>Global Properties</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.testing.fs.objectUrls_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.testing.fs.</span><span class="entryName">objectUrls_</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>.&lt;<span>?</span>,<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&gt;</div>
     </div>


     <div class="entryOverview">
       Which object URLs have been granted for fake blobs.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_testing_fs_fs.js.source.html#line66">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Package testing</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">Package Reference</h2>
            <div id="sideTypeIndex" rootPath="" current="testing.fs"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
